let trim = (string, rule='lf') => {
	let rules = ['all', 'left', 'right', 'lf'];
	rule = rules.indexOf(rule) != '-1' ? rule : 'lf';
	string = typeof string == 'string' ? string : '';
	if(rule == 'lf'){
		string = string.replace(/(^\s*)|(\s*$)/g, "");
	} else if (rule == 'left'){
		string = string.replace(/(^\s*)/g,"");
	} else if (rule == 'right'){
		string = string.replace(/(\s*$)/g,"");
	} else if (rule == 'all'){
		string = string.split(" ");
		string = string.join("");
	}
	return string;
}
export default trim